<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{ width: 100px; height: 100px; background-color: skyblue;position: absolute; top:0;left: 0;}
    </style>
</head>
<body>
    <button>按钮</button>
    <!-- <div></div> -->
    <!-- 运动函数需要是getStyle函数获取样式  一定要保证common.js先被载入 -->
    <script src="common.js"></script>
    <script src="sports.js"></script>
    <script>
        document.querySelector('div').onclick = function(){
            animate(this,{left:300},function(){
                animate(document.querySelector('div'),{top:300})
            }) 
        }
        // document.querySelector('button').timer = 20;
        // document.querySelector('button').onclick = function(){
        //     console.log(this.timer)
        // };
    </script>
</body>
</html>